// src/store/index.js

import { createStore } from 'vuex'

const store = createStore({
  state: {
    // 初始化状态
    deviceTypeStr: null,
    beforeAllDevice: null,
    variableList: null,
    ComStatus: false,
  },
  mutations: {
    deviceTypeStrupdate(state, newValue) {
      state.deviceTypeStr = newValue
    },
    beforeAllDeviceupdate(state, newValue) {
      const list = newValue.filter((item) => item.isDelete === 0)
      state.beforeAllDevice = list
    },
    getNewvariableList(state, newValue) {
      state.variableList = newValue
    },
    getComStatus(state, newValue) {
      state.ComStatus = newValue
    }
  },
  actions: {
  },
  getters: {

  },
})

export default store
